﻿using System;

namespace DataCoreTechnologies.SqlServer
{
   /// <summary>
   /// The type of database object contained in this class.
   /// </summary>
   public enum DatabaseObjectType
   {
      Undefined,
      SystemTable,
      UserTable,
      SystemView,
      UserView,
      StoredProcedure,
      Function
   }

   /// <summary>
   /// Contains information about a object contained in a database.
   /// </summary>
   public abstract class DatabaseObject
   {
      #region Public
      //Properties
      /// <summary>
      /// A number used to uniquely identify this class instance.
      /// </summary>
      public Guid InstanceId { get; internal set; }
      /// <summary>
      /// The schema this database object belongs to.
      /// </summary>
      public Schema Schema { get; internal set; }
      /// <summary>
      /// A title used to identify this object within the database.
      /// </summary>
      public string Name { get; internal set; }
      /// <summary>
      /// The date this object was created in the database.
      /// </summary>
      public DateTime? CreateDate { get; internal set; }
      /// <summary>
      /// The last time this object was modified in the database.
      /// </summary>
      public DateTime? ModifiedDate { get; internal set; }
      /// <summary>
      /// A short explanation explaining the purpose of the object.
      /// </summary>
      public string Description { get; internal set; }
      /// <summary>
      /// The type of database object contained in this class.
      /// </summary>
      public DatabaseObjectType Type { get; internal set; }
      #endregion Public
      #region Internal
      //Properties
      /// <summary>
      /// A number used to uniquely identify this object within the database.
      /// </summary>
      internal int Id { get; set; }
      #endregion Internal
   }
}
